#include "Extra Headers.h"

int main()
{
	Book * B = Book_Load();
	if(!B)B=Book_Create();
	Book_Interface(B);

	//Entry # 2 Week 2 Testing Begin
	//int i = 0,c = 0;
	//char * csz = (char*)malloc(sizeof(char) * 8);
	//BUFFER * B = NULL;
	//B = Buffer_Create(0);
	//Buffer_Add_Char(B,'1');

	//Buffer_Print_Whole_Buffer(B,IGNORE_POS,IGNORE_POS);
	//Entry # 2 Week 2 Testing End
	//_getch();
	return 0;
}

void Clear_Screen(int H,int D)
{
	int i,j;
	Set_Cursor_XY(0,0);
	if(D == 80)
	{
		for(i = 0;i < H;++i)
		{
			printf("                                                                                ");
		}
	}
	else
	{
		for(i = 0;i < H;++i)
		{
			for(j = 0;j < D;++j)
				printf(" ");
			if(D < 80)
				printf("\n");
		}
	}
	Set_Cursor_XY(0,0);
}

void Set_Cursor_XY(int x,int y)
{
	COORD XY;
	XY.X = x;
	XY.Y = y;
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), XY);
}

void Set_Cursor_XYA(COORD C)
{
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), C);
}

COORD Get_Cursor_XY()
{
	PCONSOLE_SCREEN_BUFFER_INFO SBInfo = NULL;
	COORD C;
	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), SBInfo);
	C.X = SBInfo->dwCursorPosition.X;
	C.Y = SBInfo->dwCursorPosition.Y;
	return C;
}